/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package tv.seguridad.modelo;

import java.io.Serializable;
import java.util.Date;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Id;
import javax.persistence.IdClass;
import javax.persistence.Table;
import javax.persistence.Temporal;
import javax.persistence.TemporalType;

/**
 *
 * @author ctrosch
 */
@Entity
@Table(name = "USR_TVESTA")
@IdClass(EstadisticaPK.class )
public class UsuarioEstadistica implements Serializable {
    private static final long serialVersionUID = 1L;
    
    @Id
    @Column(name = "USR_TVESTA_USERID", nullable = false, length = 40)
    private String userid;
    @Id
    @Column(name = "USR_TVESTA_FECHA", nullable = false)
    @Temporal(TemporalType.DATE)
    private Date fecha;

    @Column(name = "USR_TVESTA_HORA", nullable = false)
    @Temporal(TemporalType.TIMESTAMP)
    private Date hora;

    @Column(name = "USR_TVESTA_ACCION", length = 80)
    private String accion;
    @Column(name = "USR_TV_FECALT")
    @Temporal(TemporalType.DATE)
    private Date fecalt;
    @Column(name = "USR_TV_FECMOD")
    @Temporal(TemporalType.DATE)
    private Date fecmod;
    @Column(name = "USR_TV_ULTOPR")
    private Character ultopr;
    @Column(name = "USR_TV_DEBAJA")
    private Character debaja;
    @Column(name = "USR_TV_OALIAS", length = 10)
    private String oalias;
    

    public UsuarioEstadistica() {
        debaja = 'N';
    }

    public String getUserid() {
        return userid;
    }

    public void setUserid(String userid) {
        this.userid = userid;
    }

    public String getAccion() {
        return accion;
    }

    public void setAccion(String accion) {
        this.accion = accion;
    }

    public Character getDebaja() {
        return debaja;
    }

    public void setDebaja(Character debaja) {
        this.debaja = debaja;
    }

    public Date getFecalt() {
        return fecalt;
    }

    public void setFecalt(Date fecalt) {
        this.fecalt = fecalt;
    }

    public Date getFecha() {
        return fecha;
    }

    public void setFecha(Date fecha) {
        this.fecha = fecha;
    }

    public Date getFecmod() {
        return fecmod;
    }

    public void setFecmod(Date fecmod) {
        this.fecmod = fecmod;
    }

    public Date getHora() {
        return hora;
    }

    public void setHora(Date hora) {
        this.hora = hora;
    }
    
    public String getOalias() {
        return oalias;
    }

    public void setOalias(String oalias) {
        this.oalias = oalias;
    }

    public Character getUltopr() {
        return ultopr;
    }

    public void setUltopr(Character ultopr) {
        this.ultopr = ultopr;
    }

    @Override
    public boolean equals(Object obj) {
        if (obj == null) {
            return false;
        }
        if (getClass() != obj.getClass()) {
            return false;
        }
        final UsuarioEstadistica other = (UsuarioEstadistica) obj;
        if ((this.userid == null) ? (other.userid != null) : !this.userid.equals(other.userid)) {
            return false;
        }
        if (this.fecha != other.fecha && (this.fecha == null || !this.fecha.equals(other.fecha))) {
            return false;
        }
        return true;
    }

    @Override
    public int hashCode() {
        int hash = 7;
        hash = 83 * hash + (this.userid != null ? this.userid.hashCode() : 0);
        hash = 83 * hash + (this.fecha != null ? this.fecha.hashCode() : 0);
        return hash;
    }

    


}
